﻿using System;
using System.Collections.Generic;
using System.Web.Mvc;
using System.ComponentModel;
using System.Globalization;

namespace EcoTourEduca.BingYourMaps.ViewModels
{
	public class EditBingMapsLocationViewModel
	{
		#region BingMapsLocation properties

        [DisplayName("Friendly name")]
        public string FriendlyName { get; set; }
		[DisplayName("Latitude")]
		public string LatitudeStr { get; set; }
        [DisplayName("Longitude")]
		public string LongitudeStr { get; set; }
        [DisplayName("Show map")]
        public bool HideMap { get; set; }
        [DisplayName("Map width")]
        public int? MapWidth { get; set; }
        [DisplayName("Map height")]
        public int MapHeight { get; set; }
        [DisplayName("Map zoom")]
		public int MapZoom { get; set; }
        [DisplayName("Map type")]
		public String MapType { get; set; }
        [DisplayName("Pin icon")]
		public String PinIcon { get; set; }

		public float Latitude
		{
			get
			{
				return Convert.ToSingle(LatitudeStr, CultureInfo.InvariantCulture.NumberFormat);
			}
		}

		public float Longitude
		{
			get
			{
				return Convert.ToSingle(LongitudeStr, CultureInfo.InvariantCulture.NumberFormat);
			}
		}

		#endregion

        /// <summary>
        /// Default Bing Maps height.
        /// </summary>
        public const int DefaultMapHeight = 300;

        /// <summary>
        /// List of all available BingMapsAreas.
        /// </summary>
        public IList<BingMapsAreaViewModel> BingMapAreas { get; set; }

		/// <summary>
        /// The types of maps available.
		/// </summary>
		public SelectList MapTypeList { get; set; }

        /// <summary>
        /// List of possible pin icons.
        /// </summary>
		public IEnumerable<string> PossiblePinIcons;

        /// <summary>
        /// Folder of all available pin icons.
        /// </summary>
		public string PinIconsFolder { get; set; }
	}
}